package xin.nick;

import org.apache.dubbo.config.RegistryConfig;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

import java.io.IOException;

/**
 * @author Nick
 * @date 2021/7/17
 * @description
 */
public class DubboProviderMain {

    private static final Logger logger = LoggerFactory.getLogger(DubboProviderMain.class);

    public static void main(String[] args) {

        AnnotationConfigApplicationContext context =
                new AnnotationConfigApplicationContext(ProviderConfiguration.class);

        context.start();

        logger.info("提供者启动....");
        try {
            System.in.read();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    @Configuration
    @EnableDubbo
    @PropertySource("classpath:/dubbo-provider.properties")
    static class ProviderConfiguration {

    }

}
